package com.lrs.java.j2se_self.ioReview;
import java.io.*;

public class TestFileOutputStream {
	public static void main(String[] args){
		FileInputStream in = null;
		FileOutputStream out = null;
		int b = 0;
		try{
			in = new FileInputStream("C:\\test.java");
			out = new FileOutputStream("C:\\test2.java");
			
			while((b = in.read())!=-1){
				out.write(b);
			}
			in.close();
			out.close();
		}catch(FileNotFoundException e){
			e.getMessage();
			System.out.println("文件读取错误!");
		}catch(IOException e2){
			e2.printStackTrace();
			System.out.println("文件复制错误!");
		}
		System.out.println("文件复制完成!");
	}
}
